﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OPM.Class;
using OPM.Models;

namespace OPM.Controllers
{
    public class MessageController : Controller
    {
        //
        // GET: /Message/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Detail(string id)
        {
            var NewsDetail = WSO.GetNewsDetail(U.Token, id);
            var news_detail_list = new List<GetMessage>();

         
                news_detail_list.Add(new GetMessage
                {
                    title_th = NewsDetail.title_th,
                    detail_th = NewsDetail.detail_th,
                    date_start = NewsDetail.date_start,
                    date_expire = NewsDetail.date_expire,
                    id = NewsDetail.id,
                    is_public = NewsDetail.is_public,
                    detail_en = NewsDetail.detail_en,
                    remark = NewsDetail.remark,
                    seq = NewsDetail.seq,
                    tq_key = NewsDetail.tq_key

                });
            

            ViewBag.News = news_detail_list;
            return View();
        }
    }
}
